package com.twu.bibilioteca;

import junit.framework.TestCase;
import org.junit.Before;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;

/**
 * Created by IntelliJ IDEA.
 * User: dixithk
 * Date: 6/12/14
 * Time: 5:35 PM
 * To change this template use File | Settings | File Templates.
 */
public class BookTest {



        Book book = new Book("Programming in c" , "Lakshmi" , 1998 ,true);



    @Test
    public void ShouldCheckForTitle()
    {
       assertEquals("Programming in c", book.getTitle());
    }

    @Test
    public void ShouldCheckForAuthor()
    {
        assertEquals("Lakshmi", book.getAuthor());
    }

    @Test
    public void ShouldCheckForPublishedYear()
    {
        assertEquals( 1998, (int)book.getPublishedYear());
    }

    @Test
    public void shouldCheckForIsCheckedOut()
    {
        assertEquals(false,book.isCheckedOut());
    }

    @Test
    public void ShouldMarkAsCheckOut()
    {
        book.markAsCheckedOut() ;
        assertEquals(true, book.isCheckedOut());


    }

    @Test
    public void ShouldMarkAsReturned()
    {
        book.markAsReturned();
        assertEquals(false, book.isCheckedOut());
    }
}
